<!--
 * @Author: zhuhaohua 250293786@qq.com
 * @Date: 2024-01-02 10:21:51
 * @LastEditors: DeluxePig 250293786@qq.com
 * @LastEditTime: 2024-06-30 22:42:19
 * @FilePath: \heart-backed\src\views\banner\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="account-container">
    <div class="page-header">
      <div class="user-img-box">
        <img :src="userData.icon" alt="" />
      </div>
      <div class="user-info-box">
        <div class="info name">{{ userData.real_name }}</div>
        <div class="info tips">开通易问题会员，尊享XX项专属特权</div>
      </div>
      <div class="edit-btn" @click="runTo('')">
        立即开通 》
      </div>
    </div>
    <div class="page-middle">
      <AccountMiddle />
    </div>
    <div class="page-foot">
      <AccountTable />
    </div>
  </div>
</template>

<script>
import AccountMiddle from './components/account-middle.vue'
import AccountTable from './components/account-table.vue'
export default {
  components: {
    AccountMiddle,
    AccountTable
  },

  data() {
    return {
      userData: {
        id: 1,
        users_uniqueid: '',
        real_name: '', // 姓名
        icon: '', // 头像
        unit_name: '', // 单位名称
        unit_logo: '', // 单位logo
        unit_department: '', // 部门
        unit_title: '', // 职位
        unit_job: '', // 任职
        intro: '', // 简介
        create_datetime: '2024-04-07 13:49:04',
        update_datetime: '2024-04-07 13:49:04',
        phone_visible_switch: 0, // 手机号可见性:0=隐藏,1=可见
        unit_level: '', // 单位级别
        real_photo: '' // 真人照片
      }
    }
  },
  created() {
    this.getUserData()
  },
  methods: {
    getUserData() {
      const data = JSON.parse(localStorage.getItem('userData'))
      this.userData = data
    }
  }
}
</script>
<style lang="scss" scoped>
.account-container {
  width: 100%;
  padding: 20px;
  height: 100%;
  overflow-y: auto;

  .page-header {
    width: 100%;
    height: 100px;
    background: linear-gradient(270deg, #1C1F23 32%, #3C425C 100%);
    border-radius: 4px;
    padding: 20px 40px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative;

    .user-img-box {
      width: 60px;
      height: 60px;
      border-radius: 50%;
      overflow: hidden;
      border: 1px solid #eee;

      img {
        width: 100%;
        height: 100%;
      }
    }

    .user-info-box {
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: flex-start;
      flex-direction: column;
      padding-left: 12px;
      font-size: 14px;
      color: #fff;

      .info {
        line-height: 26px;
      }

      .name {
        font-weight: 600;
        font-size: 20px;
        color: #FFFFFF;
        line-height: 23px;
        text-align: center;
      }

      .tips {
        font-weight: 400;
        font-size: 14px;
        color: #FFFFFF;
      }
    }

    .edit-btn {
      position: absolute;
      top: 35px;
      right: 40px;
      font-size: 12px;
      color: #fff;
      border-radius: 4px;
      padding: 4px 8px;
      cursor: pointer;
      background: #04d1b8;
    }
  }

  .page-middle {
    width: 100%;
    height: 180px;
    margin: 20px 0;
  }

  .page-foot {
    width: 100%;
    height: 500px;
    padding: 20px;
    background: #Fff;
  }
}
</style>
